<%@page import="com.mz.base.util.ATTSystem"%>
<%@ page language="java" pageEncoding="utf-8"%>
<%
	//Object sessionObj = session.getAttribute(ATTSystem.KEY_SESSION_LOGIN);
	Long userId = ATTSystem.MAP_SESSION_USERID.get(session.getId());
	if(userId==null){
		response.sendRedirect("/login.jsp");
	}
%>
<!DOCTYPE html>
<html>
  	<head>
	    <title>哈泊客户关系管理系统</title>
	    <jsp:include page="/commons/head.jsp"></jsp:include>
	    <style type="text/css">
	    	body {overflow:hidden;}
	    	.BOX {position:absolute;width:100%;height:100%;}
	    	.head {height:60px;background-color:#fff;border-bottom:2px solid #f26828;background-color:#ffd8ac;}
	    	.head .logo {max-height:40px;margin:10px;}
	    	.head .user {float:right;margin-top:15px;margin-right:20px;}
	    	.head .user .avatar {width:30px;height:30px;border-radius:50%;margin-right:5px;vertical-align:middle;float:left;}
	    	.head .user .uname {float:left;padding-top:5px;cursor:pointer;margin-right:20px;position:relative;}
	    	.head .user .uname ul {display:none;border-bottom:1px solid #ffd8ac;padding-top:27px;margin:0px;position:absolute;right:0;}
	    	.head .user .uname ul li a:hover {color:#f26828;}
	    	.head .user .uname ul li {border:1px solid #ffd8ac;border-bottom:0;background-color:#fff;padding:8px 12px;}
	    	.head .user .uname:hover ul {display:block;}
	    	.head .user .uname .icon {margin-right:5px;}
	    	.head .user .exit {margin-top:5px;display:inline-block;}
	    	.head .user .exit .icon {vertical-align:middle;margin-right:5px;}
	    	.content {}
	    	.content .menu {float:left;border-right:1px solid #f26828;}
	    	.content .iframeD {float:left;padding:8px 0px 0px 8px;background-color:#fff5ea;overflow:hide;}
	    	.foot {height:24px;line-height:24px;background-color:#ffd8ac;text-align:center;font-size:12px;border-top:1px solid #f26828;position:relative;}
	    	.foot .bHide {position:absolute;height:1px;width:200px;left:0;top:-1px;background-color:#ffd8ac;}
	    	
	    	.layui-nav {background-color:#ffd8ac;color:#f26828;}
	    	.layui-nav .layui-nav-item {border-bottom:1px solid #fddfbd;}
	    	.layui-nav .layui-nav-item a {color:#333;}
	    	.layui-nav-tree .layui-this,
			.layui-nav-tree .layui-this>a,
			.layui-nav-tree .layui-this>a:hover,
			.layui-nav-tree .layui-nav-child dd.layui-this{background-color:#f26828;}
	    	.layui-nav-tree .layui-nav-title a,
			.layui-nav-tree .layui-nav-title a:hover,
			.layui-nav-itemed>a{background-color:#f26828 !important;}
			.layui-nav-tree .layui-nav-bar{background-color:#333;}
			.layui-nav-tree .layui-nav-item a:hover{background-color:#fe8c57;}
	    	
	    </style>
  	</head>
  
  	<body>

    	<div class="BOX">
    	
	    	<div class="head">
	    		<img src="/images/logo.png" class="logo"/>
	    		<div class="user">
	    			<img src="/images/avatar.png" class="avatar"/>
	    			<div class="uname">系统管理员-管理员
	    				<ul>
	    					<li><a href="" target="mainIframe"><i class="icon icon-pwd-ccc"></i>修改密码</a></li>
	    					<li><a href=""><i class="icon icon-speaker-ccc"></i>站内信箱</a></li>
	    					<li><a href=""><i class="icon icon-msg-ccc"></i>意见反馈</a></li>
	    				</ul>
	    			</div>
	    			<a href="/logout" class="exit"><i class="icon icon-exit-ccc"></i>退出</a>
	    		</div>
	    	</div>
	    	
	    	<div class="content">
	    		
	    		<div class="menu">
					<ul class="layui-nav layui-nav-tree" lay-filter="menu" id="ulMenu"></ul>
	    		</div>
	    		
	    		<div class="iframeD" >
	    			<iframe name="mainIframe" src="" tagsrc="" border="0" frameborder="no" scrolling="auto" width="100%" style="width:100%;background-image:url(/images/bg_map.png);background-repeat:no-repeat;background-size:100% 100%;-moz-background-size:100% 100%;"></iframe>
	    		</div>
	    		
	    	</div>
	    	
	    	<div class="foot"><div class="bHide"></div>CopyRight © 2017 HABO</div>
	    	
	    </div>
    
  	</body>
</html>
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
var retJson = ajaxFun('/sys/manage', {});
if(retJson!=null && retJson.length>0){
	var html = '';
	for(var i=0,len=retJson.length; i<len; i++){
		html += '<li class="layui-nav-item">';
		html += 	'<a href="'+(retJson[i].url==null||retJson[i].url==''?'javascript:;':retJson[i].url)+'">'+retJson[i].menuName+'</a>';
		if(retJson[i].list!=null && retJson[i].list.length>0){
			html += '<dl class="layui-nav-child">';
			for(var j=0,size=retJson[i].list.length; j<size; j++){
				html += '<dd><a style="padding-left:50px;" href="'+retJson[i].list[j].url+'" target="'+(retJson[i].list[j].target=='_blank'?'_blank':'mainIframe')+'">'+retJson[i].list[j].menuName+'</a></dd>';
			}
			html += '</dl>';
		}
		html += '</li>';
	}
	$('#ulMenu').html(html);
}

layui.use('element', function(){
	var element = layui.element(); //导航的hover效果、二级菜单等功能，需要依赖element模块
  	
  	resize();
  	
  	//alert(JSON.stringify(retJson));
  
	//监听导航点击
	element.on('nav(menu)', function(elem){
		layer.msg(elem.text());
	});
	
	$(window).resize(function(){
		resize();
	});
	
	function resize(){
		$('.content').height($('.BOX').height()-$('.head').height()-$('.foot').height()-2-1);
		$('.menu, .layui-nav-tree').height($('.content').height());
		$('.iframeD').width($('.content').width()-$('.menu').width()-8-1-1).height($('.content').height()-8);
		$('.iframeD iframe').height($('.iframeD').height());
		//$('#div-content iframe').height($('#div-content').height()).width($('#div-content').width());
	}
	
});
</script>